package com.fifth.business.service.impl;

import com.fifth.business.feign.ProductFeign;
import com.fifth.business.service.ProductService;
import com.fifth.common.pojo.dto.CommonResult;
import com.fifth.common.pojo.entity.Goods;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class ProductServiceImpl implements ProductService {

    @Autowired
    private ProductFeign productFeign;
    /**
     * 查询商品信息
     * @return
     */
  /*  @Override
    public CommonResult selectAll1(Integer currentPage,Integer pageSize,Goods goods,String rid) {
        CommonResult commonResult = productFeign.GoodsAll(currentPage,pageSize,goods,rid);
        return new CommonResult(2000,"修改成功",commonResult);
    }*/

    /**
     * 根据id删除
     * @param id
     * @return
     */
    @Override
    public CommonResult goodsdelete(String id) {
        CommonResult commonResult1 = productFeign.GoodsDelete(id);
        return new CommonResult(2000,"删除成功",commonResult1);
    }

    /**
     * 添加商品
     * @param goods
     * @return
     */
    @Override
    public CommonResult goodsadd(Goods goods) {
        CommonResult commonResult2 = productFeign.GoodsInsert(goods);
        return new CommonResult(2000,"删除成功",commonResult2);
    }

    /**
     * 修改商品信息
     * @param goods
     * @return
     */
    @Override
    public CommonResult goodupdate(Goods goods) {
        CommonResult goodsupdate = productFeign.Goodsupdate(goods);
        return new CommonResult(2000,"修改成功",goodsupdate);
    }

}
